# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Andre Wayand <aur-perl-html-formattext@awayand.sleepmail.com>

pkgname=perl-html-formatter
pkgver=2.16
pkgrel=9
pkgdesc="Format HTML as plaintext"
arch=('any')
url="https://search.cpan.org/dist/HTML-Formatter/"
license=('GPL' 'PerlArtistic')
depends=('perl>=5.10.0' 'perl-file-slurp' 'perl-font-afm' 'perl-html-tree')
makedepends=('perl-module-build')
provides=('perl-html-formattext')
replaces=('perl-html-formattext')
conflicts=('perl-html-formattext')
options=(!emptydirs)
source=("https://search.cpan.org/CPAN/authors/id/N/NI/NIGELM/HTML-Formatter-$pkgver.tar.gz")
sha256sums=('cb0a0dd8aa5e8ba9ca214ce451bf4df33aa09c13e907e8d3082ddafeb30151cc')

build() {
  cd "$srcdir/HTML-Formatter-$pkgver"
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
   PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
   PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
   PERL5LIB="" PERL_LOCAL_LIB_ROOT="" \
   MODULEBUILDRC=/dev/null

  perl Makefile.PL
  make
}

package() {
  cd "$srcdir/HTML-Formatter-$pkgver"
  make install DESTDIR="${pkgdir}"
}
